<!DOCTYPE html>
<html>
<head>
	<title>获取value</title>
</head>
<body>
	<fieldset>
		<legend>01.input获取value值</legend>
		<input type="password" name="密码" value="123">
		<script type="text/javascript">
			var oIn = document.getElementsByTagName('input')[0];
			console.log(oIn.value);//123
		</script>
		<div>这种方式可以应用于text、password、hidden以及select(下拉框)</div>
	</fieldset>
	<fieldset>
		<legend>02.非input获取value值</legend>
		<div>abc<span>456</span>xyz</div>
		<script type="text/javascript">
			var oDiv = document.getElementsByTagName('div')[0];
			console.log(oDiv.innerText);//abc456xyz(这个将标签去除了)
			console.log(oDiv.innerHTML);//abc<span>456</span>xyz(这个保留html标签)
		</script>
	</fieldset>
</body>
</html>